package com.breakfast.fun.adapter.home;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.breakfast.fun.R;
import com.breakfast.fun.base.BaseListAdapter;
import com.breakfast.fun.common.CommonCart;
import com.breakfast.fun.dao.ProductCart;
import com.breakfast.fun.data.entity.home.Product;
import com.breakfast.fun.data.entity.home.Products;
import com.breakfast.fun.ui.home.HomeFragment;
import com.breakfast.fun.ui.home.gallery.GalleryProductActivity;
import com.breakfast.fun.ui.home.product.NormalProductActivity;
import com.breakfast.fun.util.DaoUtil;
import com.breakfast.fun.util.L;
import com.breakfast.fun.util.T;
import com.breakfast.fun.view.widget.PurchaseButton;

import org.greenrobot.eventbus.EventBus;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

import static com.breakfast.fun.util.DaoUtil.getProductList;
import static com.breakfast.fun.util.DaoUtil.getProductList;

/**
 * 首页分类套餐适配器
 * Created by hp on 2016/8/21.
 */
public class HomeTypeAdapter extends BaseListAdapter<Product> {

    private static final int TYPE_FC = 0;
    private static final int TYPE_NORMAL = 1;
    private static final int TYPE_HOT = 1;
    private static final int TYPE_NEW = 2;
    private static final String imageIndexStr = "http://www.52letsgo.cn";


    private int itemType;        //item类型，FC表示TOP1，TOP2的item     NORMAL表示TOP3以后的item

    private int adapterType = TYPE_HOT;    //adapter类型，1表示本周热卖，2表示人气新品

    private List<Products> productsList = new ArrayList<Products>();

    private List<ProductCart> productCarts;


    private CommonCart mCommonCart = new CommonCart();

    public HomeTypeAdapter(Context context, List<Product> list) {
        super(context, list);
        initCommonCart(context);
    }

    //NormalAdapter 中实现回到页面刷新totalPrice和Num的效果是通过setAdapter，实际上为了再次调用构造函数中的这段代码。
    public void initCommonCart(Context context) {
        mCommonCart.init(context);
        productCarts = mCommonCart.productCartDao.loadAll();
        for (int i = 0; i < productCarts.size(); i++) {
            mCommonCart.totalPrice += productCarts.get(i).getTotalPrice();
            mCommonCart.totalNum += productCarts.get(i).getNum();
        }
        mCommonCart.event.setTotalPrice(mCommonCart.totalPrice);
        mCommonCart.event.setTotalNum(mCommonCart.totalNum);
        EventBus.getDefault().post(mCommonCart.event);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        ViewHolder holder = null;
        ViewHolder2 holder2 = null;
        itemType = getItemViewType(position);

        //本周热卖
        if (adapterType == TYPE_HOT) {
            if (convertView == null) {
                if (itemType == TYPE_FC) {
                    convertView = LayoutInflater.from(mContext).inflate(R.layout.item_home_type_fc, null);
                    holder = new ViewHolder(convertView);
                    convertView.setTag(holder);
                } else {
                    convertView = LayoutInflater.from(mContext).inflate(R.layout.item_home_type, null);
                    holder2 = new ViewHolder2(convertView);
                    convertView.setTag(holder2);
                }
            } else {
                //TOP1，TOP2
                if (itemType == TYPE_FC) {
                    holder = (ViewHolder) convertView.getTag();
                } else {
                    holder2 = (ViewHolder2) convertView.getTag();
                }
            }
            Product productLeft;
            Product productRight;
            //TOP1,TOP2
            if (getItemViewType(position) == TYPE_FC) {

                productLeft = getItem(position);

                if (position == 0) {
                    holder.mLlItemHomeTypeTop.setBackgroundColor(0xffee432f);        //EE432F
                } else {
                    holder.mLlItemHomeTypeTop.setBackgroundColor(mContext.getResources().getColor(R.color.main_color));
                }


                List<ProductCart> productCarts = getProductList(productLeft.getCategoryId(), productLeft.getId(), HomeFragment.chooseDate);

                //如果数据库中有商品，就设置文本数量
                if (productCarts != null && productCarts.size() == 1) {
                    holder.mPbHomeTypeFc.setTextNum(productCarts.get(0).getNum());
                } else {
                    holder.mPbHomeTypeFc.setTextNum(0);
                }

                holder.mTvItemHomeTypePosition.setText((position + 1) + "");
                imageUtil.loadUrlImage(imageIndexStr + productLeft.getHorImage(), holder.mIvItemHomeType);

                holder.mTvItemHomeTypeProductName.setText(productLeft.getName());
                holder.mTvItemHomeTypeProductPrice.setText("￥" + String.format("%.2f", productLeft.getPrice()));

                ViewHolder finalHolder = holder;
                holder.mPbHomeTypeFc.setOnShoppingClickListener(new PurchaseButton.ShoppingClickListener() {
                    @Override
                    public void onAddClick(int num) {
                        add1(productLeft, finalHolder, finalHolder.mPbHomeTypeFc);
                    }

                    @Override
                    public void onMinusClick(int num) {
                        del1(productLeft, finalHolder);
                    }
                });

                holder.mIvItemHomeType.setOnClickListener(v -> {
                    jumpToGallery(productLeft);
                });
            } else {      //第二行 position 从 2 开始

                if (position * 2 - 2 <= mList.size() - 1) {
                    productLeft = getItem(position * 2 - 2);

                    holder2.mLlItemHomeTypeTopLeft.setVisibility(View.VISIBLE);
                    holder2.mLlItemHomeTypeTopLeft.setBackgroundColor(Color.BLACK);
                    holder2.mTvItemHomeTypePositionLeft.setText((position * 2 - 1) + "");

                    imageUtil.loadUrlImage(imageIndexStr + productLeft.getImage(), holder2.mIvItemHomeTypeLeft);

                    holder2.mTvItemHomeTypeProductNameLeft.setText(productLeft.getName());
                    holder2.mTvItemHomeTypeProductPriceLeft.setText("￥" + String.format("%.2f", productLeft.getPrice()));


                    List<ProductCart> productCarts = getProductList(productLeft.getCategoryId(), productLeft.getId(), HomeFragment.chooseDate);

                    //如果数据库中有商品，就设置文本数量
                    if (productCarts != null && productCarts.size() == 1) {
                        holder2.mPbHomeTypeLeft.setTextNum(productCarts.get(0).getNum());
                    } else {
                        holder2.mPbHomeTypeLeft.setTextNum(0);
                    }

                    ViewHolder2 finalHolder1 = holder2;
                    holder2.mPbHomeTypeLeft.setOnShoppingClickListener(new PurchaseButton.ShoppingClickListener() {
                        @Override
                        public void onAddClick(int num) {
                            add2(productLeft, finalHolder1, true, finalHolder1.mPbHomeTypeLeft);
                        }

                        @Override
                        public void onMinusClick(int num) {
                            del2(productLeft, finalHolder1, true);
                        }
                    });
                    holder2.mIvItemHomeTypeLeft.setOnClickListener(v -> {
                        jumpToGallery(productLeft);
                    });
                }
                if (position * 2 - 1 <= mList.size() - 1) {
                    holder2.mLlHomeTypeRight.setVisibility(View.VISIBLE);
                    productRight = getItem(position * 2 - 1);
                    holder2.mLlItemHomeTypeTopRight.setVisibility(View.VISIBLE);
                    holder2.mLlItemHomeTypeTopRight.setBackgroundColor(Color.BLACK);
                    holder2.mTvItemHomeTypePositionRight.setText((position * 2) + "");

                    imageUtil.loadUrlImage(imageIndexStr + productRight.getImage(), holder2.mIvItemHomeTypeRight);

                    holder2.mTvItemHomeTypeProductNameRight.setText(productRight.getName());
                    holder2.mTvItemHomeTypeProductPriceRight.setText("￥" + String.format("%.2f", productRight.getPrice()));

                    List<ProductCart> productCarts = getProductList(productRight.getCategoryId(), productRight.getId(), HomeFragment.chooseDate);

//                    //如果数据库中有商品，就设置文本数量
                    if (productCarts != null && productCarts.size() == 1) {
                        holder2.mPbHomeTypeRight.setTextNum(productCarts.get(0).getNum());
                    } else {
                        holder2.mPbHomeTypeRight.setTextNum(0);
                    }

                    ViewHolder2 finalHolder2 = holder2;
                    holder2.mPbHomeTypeRight.setOnShoppingClickListener(new PurchaseButton.ShoppingClickListener() {
                        @Override
                        public void onAddClick(int num) {
                            add2(productRight, finalHolder2, false, finalHolder2.mPbHomeTypeRight);
                        }

                        @Override
                        public void onMinusClick(int num) {
                            del2(productRight, finalHolder2, false);
                        }
                    });


                    holder2.mIvItemHomeTypeRight.setOnClickListener(v -> {
                        jumpToGallery(productRight);
                    });
                } else {
                    holder2.mLlHomeTypeRight.setVisibility(View.INVISIBLE);
                }
            }
        } else if (adapterType == TYPE_NEW) {                 //人气新品
            if (convertView == null) {
                convertView = LayoutInflater.from(mContext).inflate(R.layout.item_home_type, null);
                holder2 = new ViewHolder2(convertView);
                convertView.setTag(holder2);
            } else {
                //TOP1，TOP2
                holder2 = (ViewHolder2) convertView.getTag();
            }
            Product productLeft;
            Product productRight;
            if (position * 2 <= mList.size() - 1) {
                productLeft = getItem(position * 2);
                holder2.mLlItemHomeTypeTopLeft.setVisibility(View.GONE);
                holder2.mTvItemHomeTypePositionLeft.setText((position * 2 + 1) + "");

                imageUtil.loadUrlImage(imageIndexStr + productLeft.getImage(), holder2.mIvItemHomeTypeLeft);
                holder2.mTvItemHomeTypeProductNameLeft.setText(productLeft.getName());
                holder2.mTvItemHomeTypeProductPriceLeft.setText("￥" + String.format("%.2f", productLeft.getPrice()));

                List<ProductCart> productCarts = getProductList(productLeft.getCategoryId(), productLeft.getId(), HomeFragment.chooseDate);

                //如果数据库中有商品，就设置文本数量
                if (productCarts != null && productCarts.size() == 1) {
                    holder2.mPbHomeTypeLeft.setTextNum(productCarts.get(0).getNum());
                } else {
                    holder2.mPbHomeTypeLeft.setTextNum(0);
                }

                ViewHolder2 finalHolder3 = holder2;
                holder2.mPbHomeTypeLeft.setOnShoppingClickListener(new PurchaseButton.ShoppingClickListener() {
                    @Override
                    public void onAddClick(int num) {
                        add2(productLeft, finalHolder3, true, finalHolder3.mPbHomeTypeLeft);
                    }

                    @Override
                    public void onMinusClick(int num) {
                        del2(productLeft, finalHolder3, true);
                    }
                });

                holder2.mIvItemHomeTypeLeft.setOnClickListener(v -> {
                    jumpToGallery(productLeft);
                });
            }
            if (position * 2 + 1 <= mList.size() - 1) {
                holder2.mLlHomeTypeRight.setVisibility(View.VISIBLE);
                productRight = getItem(position * 2 + 1);
                holder2.mLlItemHomeTypeTopRight.setVisibility(View.GONE);
                holder2.mTvItemHomeTypePositionRight.setText((position * 2 + 2) + "");

                imageUtil.loadUrlImage(imageIndexStr + productRight.getImage(), holder2.mIvItemHomeTypeRight);

                holder2.mTvItemHomeTypeProductNameRight.setText(productRight.getName());
                holder2.mTvItemHomeTypeProductPriceRight.setText("￥" + String.format("%.2f", productRight.getPrice()));

                List<ProductCart> productCarts = getProductList(productRight.getCategoryId(), productRight.getId(), HomeFragment.chooseDate);
                //如果数据库中有商品，就设置文本数量
                if (productCarts != null && productCarts.size() == 1) {
                    holder2.mPbHomeTypeRight.setTextNum(productCarts.get(0).getNum());
                } else {
                    holder2.mPbHomeTypeRight.setTextNum(0);
                }

                ViewHolder2 finalHolder4 = holder2;
                holder2.mPbHomeTypeRight.setOnShoppingClickListener(new PurchaseButton.ShoppingClickListener() {
                    @Override
                    public void onAddClick(int num) {
                        add2(productRight, finalHolder4, false, finalHolder4.mPbHomeTypeRight);
                    }

                    @Override
                    public void onMinusClick(int num) {
                        del2(productRight, finalHolder4, false);
                    }
                });

                holder2.mIvItemHomeTypeRight.setOnClickListener(v -> {
                    jumpToGallery(productRight);
                });
            } else {
                holder2.mLlHomeTypeRight.setVisibility(View.INVISIBLE);
            }
        }
        return convertView;
    }

    private void jumpToGallery(Product product) {
        productsList.clear();
        Intent intent = new Intent(mContext,
                GalleryProductActivity.class);
        Bundle bundle = new Bundle();
        //将当前List<Products>传到画廊
        for (Product p : mList) {
            Products products = new Products();
            products.setDate(HomeFragment.chooseDate);
            products.setProduct(p);
            products.setCategoryId(p.getCategoryId());
            productsList.add(products);
        }
        Products products = new Products();
        products.setDate(HomeFragment.chooseDate);
        products.setProduct(product);
        products.setCategoryId(product.getCategoryId());
        bundle.putBoolean("isFromGallery", true);
        bundle.putSerializable("productLists", (Serializable) productsList);
        bundle.putSerializable("curProducts", (Serializable) products);            //当前选中的products
        if (TextUtils.isEmpty(product.getClosetime())) {
            bundle.putString("closeTime", "22:00:00");
        } else {
            bundle.putString("closeTime", product.getClosetime());
        }
        intent.putExtras(bundle);
        mContext.startActivity(intent);
    }

    //添加的逻辑是，先判断数据库中是否有商品
    //如果没有的话，就新增一条记录
    //否则，更新这条记录

    //TOP1，2 布局的添加事件
    public void add1(Product data, ViewHolder holder, View view) {
        ProductCart productCart = new ProductCart(null, data.getCategoryId(), data.getId(), HomeFragment.chooseDate);

        List<ProductCart> productCartList = getProductList(data.getCategoryId(), data.getId(), HomeFragment.chooseDate);

        if (productCartList.size() == 0) {
            productCart.setNum(1);
            productCart.setImage(imageIndexStr + data.getImage());
            productCart.setProductId(data.getId());
            productCart.setName(data.getName());
            productCart.setProductId(data.getId());
            productCart.setPrice(data.getPrice());
            productCart.setProductClassId(data.getProductClassId());
            productCart.setTotalPrice(data.getPrice());
            mCommonCart.productCartDao.insert(productCart);
            holder.mPbHomeTypeFc.setTextNum(1);

        } else {
            productCartList.get(0).setNum(productCartList.get(0).getNum() + 1);
            productCartList.get(0).setTotalPrice(productCartList.get(0).getPrice() * productCartList.get(0).getNum());
            mCommonCart.productCartDao.update(productCartList.get(0));
            holder.mPbHomeTypeFc.setTextNum(productCartList.get(0).getNum());
        }


        mCommonCart.totalNum += 1;
        mCommonCart.totalPrice += data.getPrice();
        mCommonCart.event.setTotalNum(mCommonCart.totalNum);
        mCommonCart.event.setTotalPrice(mCommonCart.totalPrice);
        EventBus.getDefault().post(mCommonCart.event);
        if (mAddClick != null) {
            mAddClick.add(view);
        }
        holder.mPbHomeTypeFc.clearAnimation();
    }

    //有左右布局的添加事件
    public void add2(Product data, ViewHolder2 holder, boolean isLeft, View view) {
        ProductCart productCart = new ProductCart(null, data.getCategoryId(), data.getId(), HomeFragment.chooseDate);

        List<ProductCart> productCartList = getProductList(data.getCategoryId(), data.getId(), HomeFragment.chooseDate);
        if (productCartList.size() == 0) {
            productCart.setNum(1);
            productCart.setImage(imageIndexStr + data.getImage());
            productCart.setProductId(data.getId());
            productCart.setName(data.getName());
            productCart.setProductId(data.getId());
            productCart.setPrice(data.getPrice());
            productCart.setProductClassId(data.getProductClassId());
            productCart.setTotalPrice(data.getPrice());
            mCommonCart.productCartDao.insert(productCart);
            if (isLeft) {
                holder.mPbHomeTypeLeft.setTextNum(1);
            } else {
                holder.mPbHomeTypeRight.setTextNum(1);
            }
        } else {
            productCartList.get(0).setNum(productCartList.get(0).getNum() + 1);
            productCartList.get(0).setTotalPrice(productCartList.get(0).getPrice() * productCartList.get(0).getNum());
            mCommonCart.productCartDao.update(productCartList.get(0));
            if (isLeft) {
                holder.mPbHomeTypeLeft.setTextNum(productCartList.get(0).getNum());
            } else {
                holder.mPbHomeTypeRight.setTextNum(productCartList.get(0).getNum());
            }
        }

        mCommonCart.totalNum += 1;
        mCommonCart.totalPrice += data.getPrice();
        mCommonCart.event.setTotalNum(mCommonCart.totalNum);
        mCommonCart.event.setTotalPrice(mCommonCart.totalPrice);
        EventBus.getDefault().post(mCommonCart.event);

        if (mAddClick != null) {
            mAddClick.add(view);
        }
        if (isLeft) {
            holder.mPbHomeTypeLeft.clearAnimation();
        } else {
            holder.mPbHomeTypeRight.clearAnimation();
        }
    }

    //删除的逻辑和增加的逻辑类似
    //如果更新记录后商品的数量变成0的话
    //就删除这条记录
    //TOP1,2 布局的删除事件
    public void del1(Product data, ViewHolder holder) {

        List<ProductCart> productCartList = DaoUtil.getProductList(data.getCategoryId(), data.getId(), HomeFragment.chooseDate);
        productCartList.get(0).setNum(productCartList.get(0).getNum() - 1);
        productCartList.get(0).setTotalPrice(productCartList.get(0).getPrice()
                * productCartList.get(0).getNum());
        mCommonCart.productCartDao.update(productCartList.get(0));
        holder.mPbHomeTypeFc.setTextNum(productCartList.get(0).getNum());
        if (holder.mPbHomeTypeFc.getTextNum() == 0) {
            mCommonCart.productCartDao.delete(productCartList.get(0));
        }
        mCommonCart.totalNum -= 1;
        mCommonCart.totalPrice -= data.getPrice();
        mCommonCart.event.setTotalNum(mCommonCart.totalNum);
        mCommonCart.event.setTotalPrice(mCommonCart.totalPrice);
        EventBus.getDefault().post(mCommonCart.event);
        holder.mPbHomeTypeFc.clearAnimation();
    }


    //TOP1,2之后布局的删除事件
    public void del2(Product data, ViewHolder2 holder, boolean isLeft) {
        List<ProductCart> productCartList = DaoUtil.getProductList(data.getCategoryId(), data.getId(), HomeFragment.chooseDate);
        productCartList.get(0).setNum(productCartList.get(0).getNum() - 1);
        productCartList.get(0).setTotalPrice(productCartList.get(0).getPrice()
                * productCartList.get(0).getNum());
        mCommonCart.productCartDao.update(productCartList.get(0));
        if (isLeft) {
            holder.mPbHomeTypeLeft.setTextNum(productCartList.get(0).getNum());
            if (holder.mPbHomeTypeLeft.getTextNum() == 0) {
                mCommonCart.productCartDao.delete(productCartList.get(0));
            }
        } else {
            holder.mPbHomeTypeRight.setTextNum(productCartList.get(0).getNum());
            if (holder.mPbHomeTypeRight.getTextNum() == 0) {
                mCommonCart.productCartDao.delete(productCartList.get(0));
            }
        }
        mCommonCart.totalNum -= 1;
        mCommonCart.totalPrice -= data.getPrice();
        mCommonCart.event.setTotalNum(mCommonCart.totalNum);
        mCommonCart.event.setTotalPrice(mCommonCart.totalPrice);
        EventBus.getDefault().post(mCommonCart.event);
        if (isLeft) {
            holder.mPbHomeTypeLeft.clearAnimation();
        } else {
            holder.mPbHomeTypeRight.clearAnimation();
        }
    }

    @Override
    public int getCount() {
        if (adapterType == TYPE_HOT) {
            if (mList.size() <= 2) {
                return mList.size();
            } else {
                return (int) (2 + Math.round((mList.size() - 2) / 2.0));
            }
        } else {
            return (int) Math.round(mList.size() / 2.0);
        }
    }

    @Override
    public int getItemViewType(int position) {
        return adapterType == TYPE_HOT && (position == 0 || position == 1) ? TYPE_FC : TYPE_NORMAL;
    }

    @Override
    public int getViewTypeCount() {
        return 2;
    }

    public int getAdapterType() {
        return adapterType;
    }

    public void setAdapterType(int adapterType) {
        this.adapterType = adapterType;
    }

    private addClick mAddClick;

    public interface addClick {
        void add(View view);
    }

    public void setAddClick(addClick addClick) {
        mAddClick = addClick;
    }

    static class ViewHolder {
        //TOP1、TOP2的布局
        @Bind(R.id.iv_item_home_type)
        ImageView mIvItemHomeType;
        @Bind(R.id.pb_home_type_fc)
        PurchaseButton mPbHomeTypeFc;
        //        @Bind(R.id.tv_item_home_type_del)
//        TextView mTvItemHomeTypeDel;
//        @Bind(R.id.tv_item_home_type_count)
//        TextView mTvItemHomeTypeCount;
//        @Bind(R.id.ll_item_home_type_add_del)
//        LinearLayout mLlItemHomeTypeAddDel;
//        @Bind(R.id.tv_item_home_type_add_bg)
//        TextView mTvItemHomeTypeAddBg;
//        @Bind(R.id.tv_item_home_type_add)
//        TextView mTvItemHomeTypeAdd;
        @Bind(R.id.tv_item_home_type_position)
        TextView mTvItemHomeTypePosition;
        @Bind(R.id.ll_item_home_type_top)
        LinearLayout mLlItemHomeTypeTop;
        @Bind(R.id.tv_item_home_type_product_name)
        TextView mTvItemHomeTypeProductName;
        @Bind(R.id.tv_item_home_type_product_price)
        TextView mTvItemHomeTypeProductPrice;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }

    static class ViewHolder2 {
        @Bind(R.id.iv_item_home_type_left)
        ImageView mIvItemHomeTypeLeft;
        @Bind(R.id.pb_home_type_left)
        PurchaseButton mPbHomeTypeLeft;
        //        @Bind(R.id.tv_item_home_type_del_left)
//        TextView mTvItemHomeTypeDelLeft;
//        @Bind(R.id.tv_item_home_type_count_left)
//        TextView mTvItemHomeTypeCountLeft;
//        @Bind(R.id.tv_item_product_add_empty)
//        TextView mTvItemProductAddEmpty;
//        @Bind(R.id.ll_item_home_type_add_del_left)
//        LinearLayout mLlItemHomeTypeAddDelLeft;
//        @Bind(R.id.tv_item_home_type_add_bg_left)
//        TextView mTvItemHomeTypeAddBgLeft;
//        @Bind(R.id.tv_item_home_type_add_left)
//        TextView mTvItemHomeTypeAddLeft;
        @Bind(R.id.tv_item_home_type_position_left)
        TextView mTvItemHomeTypePositionLeft;
        @Bind(R.id.ll_item_home_type_top_left)
        LinearLayout mLlItemHomeTypeTopLeft;
        @Bind(R.id.tv_item_home_type_product_name_left)
        TextView mTvItemHomeTypeProductNameLeft;
        @Bind(R.id.tv_item_home_type_product_price_left)
        TextView mTvItemHomeTypeProductPriceLeft;
        @Bind(R.id.iv_item_home_type_right)
        ImageView mIvItemHomeTypeRight;
        @Bind(R.id.pb_home_type_right)
        PurchaseButton mPbHomeTypeRight;
        @Bind(R.id.tv_item_home_type_position_right)
        TextView mTvItemHomeTypePositionRight;
        @Bind(R.id.ll_item_home_type_top_right)
        LinearLayout mLlItemHomeTypeTopRight;
        @Bind(R.id.tv_item_home_type_product_name_right)
        TextView mTvItemHomeTypeProductNameRight;
        @Bind(R.id.tv_item_home_type_product_price_right)
        TextView mTvItemHomeTypeProductPriceRight;
        @Bind(R.id.ll_home_type_right)
        LinearLayout mLlHomeTypeRight;

        ViewHolder2(View view) {
            ButterKnife.bind(this, view);
        }
    }


}
